]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st/texture-cache: Drop bind_surface_property() method
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 14 Dec 2023 20:46:12 +0000 (21:46 +0100)
committerMarge Bot <marge-bot@gnome.org>
Fri, 15 Dec 2023 14:10:53 +0000 (14:10 +0000)
It was only used for the fallback icon of X11 windows.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3056>

src/st/st-texture-cache.c
src/st/st-texture-cache.h

index 8d773dabb7cba3245b324268c21697b30295f2be..b93db94b5a37e3a8b1dd3b09eee785d4a1e7f009 100644 (file)
@@ -799,14 +799,6 @@ load_texture_async (StTextureCache       *cache,
     g_assert_not_reached ();
 }
 
-typedef struct {
-  StTextureCache *cache;
-  ClutterContent *image;
-  GObject *source;
-  gulong notify_signal_id;
-  gboolean weakref_active;
-} StTextureCachePropertyBind;
-
 static void
 st_texture_cache_load_surface (ClutterContent  **image,
                                cairo_surface_t  *surface)
@@ -846,84 +838,6 @@ st_texture_cache_load_surface (ClutterContent  **image,
     }
 }
 
-static void
-st_texture_cache_reset_texture (StTextureCachePropertyBind *bind,
-                                const char                 *propname)
-{
-  cairo_surface_t *surface;
-
-  g_object_get (bind->source, propname, &surface, NULL);
-
-  st_texture_cache_load_surface (&bind->image, surface);
-}
-
-static void
-st_texture_cache_on_pixbuf_notify (GObject           *object,
-                                   GParamSpec        *paramspec,
-                                   gpointer           data)
-{
-  StTextureCachePropertyBind *bind = data;
-  st_texture_cache_reset_texture (bind, paramspec->name);
-}
-
-static void
-st_texture_cache_bind_weak_notify (gpointer     data,
-                                   GObject     *source_location)
-{
-  StTextureCachePropertyBind *bind = data;
-  bind->weakref_active = FALSE;
-  g_signal_handler_disconnect (bind->source, bind->notify_signal_id);
-}
-
-static void
-st_texture_cache_free_bind (gpointer data)
-{
-  StTextureCachePropertyBind *bind = data;
-  if (bind->weakref_active)
-    g_object_weak_unref (G_OBJECT (bind->image), st_texture_cache_bind_weak_notify, bind);
-  g_free (bind);
-}
-
-/**
- * st_texture_cache_bind_cairo_surface_property:
- * @cache: A #StTextureCache
- * @object: A #GObject with a property @property_name of type #cairo_surface_t
- * @property_name: Name of a property
- *
- * Create a #GIcon which tracks the #cairo_surface_t value of a GObject property
- * named by @property_name.  Unlike other methods in StTextureCache, the underlying
- * #CoglTexture is not shared by default with other invocations to this method.
- *
- * If the source object is destroyed, the texture will continue to show the last
- * value of the property.
- *
- * Returns: (transfer full): A new #GIcon
- */
-GIcon *
-st_texture_cache_bind_cairo_surface_property (StTextureCache    *cache,
-                                              GObject           *object,
-                                              const char        *property_name)
-{
-  gchar *notify_key;
-  StTextureCachePropertyBind *bind;
-
-  bind = g_new0 (StTextureCachePropertyBind, 1);
-  bind->cache = cache;
-  bind->source = object;
-
-  st_texture_cache_reset_texture (bind, property_name);
-
-  g_object_weak_ref (G_OBJECT (bind->image), st_texture_cache_bind_weak_notify, bind);
-  bind->weakref_active = TRUE;
-
-  notify_key = g_strdup_printf ("notify::%s", property_name);
-  bind->notify_signal_id = g_signal_connect_data (object, notify_key, G_CALLBACK(st_texture_cache_on_pixbuf_notify),
-                                                  bind, (GClosureNotify)st_texture_cache_free_bind, 0);
-  g_free (notify_key);
-
-  return G_ICON (bind->image);
-}
-
 /**
  * st_texture_cache_load_cairo_surface_to_gicon:
  * @cache: A #StTextureCache
index b7d8672262b5ad14e1df2b6908b0fbc42f817e57..1c5be957c4ef399db9c71026c69d88cf36268492 100644 (file)
@@ -63,9 +63,6 @@ st_texture_cache_load_sliced_image (StTextureCache *cache,
                                     GFunc           load_callback,
                                     gpointer        user_data);
 
-GIcon *st_texture_cache_bind_cairo_surface_property (StTextureCache    *cache,
-                                                     GObject           *object,
-                                                     const char *property_name);
 GIcon *
 st_texture_cache_load_cairo_surface_to_gicon (StTextureCache  *cache,
                                               cairo_surface_t *surface);